<?php
/*
  功能：用户答题-题信息表 model
  作者：cxm
  时间：2019-10-23
*/

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class UserQuestion extends BaseModel {
    use SoftDeletes;
    protected $dates = ['deleted_at']; //开启deleted_at
    protected $table='user_question';  //绑定表

    /**
     * 用户ID
     * @param $user_id
     * @return mixed
     */
    public static function nowDay($user_id){
        return self::where('user_id',$user_id)
            ->whereDate('created_at',date('Y-m-d'))
            ->first();
    }
}